import { BrowserRouter, Route, Routes } from 'react-router-dom'
import Login from '@/pages/Login/index'
import Layout from '@/pages/Layout'
import Home from './pages/Home'
import Article from './pages/Article'
import Publish from './pages/Publish'
import { AuthComponent } from '@/componnents/AuthComponent'
import './App.css'
function App () {
  return (
    <BrowserRouter>
      <div className="App">
        <Routes>
          {/* 高阶组件AuthComponent得使用 */}
          <Route path='/' element={<AuthComponent><Layout /></AuthComponent>}>
            <Route index element={<Home></Home>}></Route>
            {/* 进入主页后得二级组件 */}
            <Route path='/article' element={<Article></Article>}></Route>
            <Route path='/publish' element={<Publish></Publish>}></Route>
          </Route>
          <Route path='/login' element={<Login />}></Route>
        </Routes>
      </div>
    </BrowserRouter>
  )
}

export default App
